<template>
    <Layout style="width:100%;height:100%;">
        <Sider hide-trigger>
            <Menu :theme="theme2" :active-name="activeName" @on-select="linlTo" style="width:200px;">
                <MenuItem name="fullCut">满额立减</MenuItem>
                <!-- <MenuItem name="newCut">新客立减</MenuItem> -->
            </Menu>
        </Sider>
        <Content>
            <router-view></router-view>
        </Content>
    </Layout>
</template>
<script>
import { mapGetters, mapMutations, mapActions } from "vuex";
export default {
  data() {
    return {
      theme2: "light",
      activeName: ''
    };
  },
  computed: {
    
  },
  methods: {
    ...mapActions(["checkTIndex"]),
    // 点击导航菜单跳转路由
    linlTo(name) {
      var that = this;
      that.activeName = name
      sessionStorage.setItem('activeShop', that.activeName)
      that.$router.push(`/storeMenu/${name}`);
    }
  },
  mounted() {
    if (this.$route.name == 'fullCut') {
        sessionStorage.setItem('activeShop', 'fullCut')
    }
    this.activeName = sessionStorage.getItem('activeShop')
  },
  created() {
    this.$store.dispatch("checkTIndex","/storeMenu")
  },
  beforeDestroy() {
    sessionStorage.setItem('activeShop', 'fullCut')
  }
};
</script>
